package com.lycx.businessmanager.controller;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;


/**
 * 字典controller
 * 
 * @author lambert
 * 
 */

@Controller
@RequestMapping("/menu")
public class MenuController {
	@SuppressWarnings("unused")
	private static Logger log = Logger.getLogger(MenuController.class);

	@RequestMapping(value = "/link", method = RequestMethod.GET)
	public ModelAndView link(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView mv = new ModelAndView();
		String currentMenu = request.getParameter("menu");
		if(currentMenu==null || currentMenu.equals("")){
			currentMenu = "index";
		}
        if(currentMenu.equals("index")){
        	mv.setViewName("redirect:/index.jsp");
        }else{
        	mv.setViewName("/menu/menu");
        }
        request.getSession().setAttribute("currentMenu", currentMenu);
		return mv;
	}

}
